package cn.pli.bike.ui;

import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.framemodule.base.BaseDelegate;

import cn.pli.bike.R;

/**
 * 具体问题
 */
public class ProblemDetailDelegate extends BaseDelegate {
    private TextView tvTitle;

    private EditText etBikeNumber;            //输入锁编号
    private ImageView ivScan;                     //打开二维码扫描
    private RecyclerView recyclerViewProblem;       //问题列表
    private EditText etDetail;                      //问题补充描述
    private ImageView ivTakePhoto;                   //
    private ProblemTypeAdapter problemTypeAdapter;


    @Override
    public void initTitleBar() {

    }

    @Override
    public int getRootLayoutId() {
        return R.layout.activity_problem_detail;
    }

    @Override
    public void initWidget() {
        super.initWidget();
        etBikeNumber = get(R.id.et_input_bike_code);
        ivScan = get(R.id.iv_qr_scan_logo);
        recyclerViewProblem = get(R.id.recycler_problem_list);
        etDetail = get(R.id.et_problem_description);
        ivTakePhoto = get(R.id.tv_take_photo);
        problemTypeAdapter = new ProblemTypeAdapter(recyclerViewProblem);
        recyclerViewProblem.setLayoutManager(new GridLayoutManager(this.getActivity(), 3));
        recyclerViewProblem.setAdapter(problemTypeAdapter);
        tvTitle = get(R.id.tv_title);
        tvTitle.setText(R.string.service_center);

    }

    public RecyclerView getRecyclerView() {
        return recyclerViewProblem;
    }

    public ProblemTypeAdapter getProblemTypeAdapter() {
        return problemTypeAdapter;
    }

    public void setProblemTypeAdapter(ProblemTypeAdapter problemTypeAdapter) {
        this.problemTypeAdapter = problemTypeAdapter;
    }

    public void setTvTitle(String title) {
        tvTitle.setText(title);
    }

    public EditText getEtDetail() {
        return etDetail;
    }
}
